<!DOCTYPE html>
<html lang="zh" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="main">
    <p>哎呀！</p>
    <p id="detail" th:text="${message}"></p>
</div>

<script>
    alert(document.getElementById('detail').innerText);
</script>


</body>
</html>